<?php
/**
 * Created by PhpStorm.
 * User: xiaom
 * Date: 2016/12/24
 * Time: 17:54
 */

namespace Ow\Controller;

use Think\Controller;

class GuestbookController extends Controller
{

    protected $guestbook_model;

    public function _initialize() {
        $this->guestbook_model=D("Common/Guestbook");
    }

    public function add(){
        $data['full_name']=I('full_name');
        $data['tell']=I('tell');
        $data['email']=I('email');
        $data['msg']=I('msg');
        $data['createtime']=date("Y-m-d h:i:s");
        if ($this->guestbook_model->add($data)){
            $this->success('添加留言成功');
        }else{
            $this->error("添加留言失败");
        }
    }
}